package com.lovo.sqlatm;

import com.lovo.fileUtil.FileUtil;

import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;

public class Test0 extends JFrame {
    private CardLayout cardLayout = new CardLayout();
    private Menu menu1 = new Menu(this);
    private Login log1 = new Login(this);
    private Inquire inquire =new Inquire(this);
    private Savers savers =new Savers(this);
    private Withdrawal teller =new Withdrawal(this);
    private Revise revise=new Revise(this);
    private Transfer transfer=new Transfer(this);
    private List<Uesr> list ;
    private Uesr uesr;
    private int number;

    private Uesr loginUser;

    public Uesr getLoginUser() {
        return loginUser;
    }

    public void setLoginUser(Uesr loginUser) {
        this.loginUser = loginUser;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public Uesr getUesr() {
        return uesr;
    }

    public void setUesr(Uesr uesr) {
        this.uesr = uesr;
    }

    public Inquire getLnquire() {
        return inquire;
    }

    public void setLnquire(Inquire inquire) {
        this.inquire = inquire;
    }



    public List<Uesr> getList() {
        return list;
    }

    public void setList(List<Uesr> list) {
        this.list = list;
    }

    private Image image1 = Util.getImage("/img/background.jpg");



    public Test0() {
//        uesr1r=(Uesr) FileUtil.rederObject("d:/b/login.dzt");





        //传入背景图
        this.setContentPane(new JPanel() {
            @Override
            protected void paintComponent(Graphics g) {
                super.paintComponent(g);
                g.drawImage(image1, 0, 0, 1024, 768, this);
            }
        });



        //卡片
        this.setLayout(cardLayout);

        this.add("login", log1);
        this.add("menu", menu1);
        this.add("lnquire", inquire);
        this.add("save",savers);
        this.add("teller",teller);
        this.add("revise",revise);
        this.add("transfer",transfer);


        //窗口体大小
        this.setSize(1024, 768);
        //居中
        this.setLocationRelativeTo(null);
        //关闭内存
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        //窗口可视化
        this.setVisible(true);
    }






        public void switchPanel (String name){
            cardLayout.show(this.getContentPane(), name);
        }

        public static void main (String[]args){

            new Test0();
        }


    }